<script setup>
// 路由已经在main.js中注册，这里不需要额外导入
</script>

<template>
  <div class="app-container">
    <!-- 导航栏 -->
    <nav class="navbar">
      <div class="navbar-brand">OpenLayers地图演示系统</div>
      <div class="navbar-links">
        <router-link to="/" class="nav-link">首页</router-link>
        <!-- <router-link to="/wfs-add-feature" class="nav-link">WFS添加要素</router-link> -->
        <router-link to="/basic-map" class="nav-link">基础地图</router-link>
        <router-link to="/vector-draw" class="nav-link">矢量绘制</router-link>
        <router-link to="/distance-area" class="nav-link">地图测量</router-link>
        <router-link to="/GeoServerService" class="nav-link">GeoServer服务</router-link>
        <router-link to="/turf-analysis" class="nav-link">Turf空间分析</router-link>
        <router-link to="/wps" class="nav-link">WPS空间分析</router-link>
      </div>
    </nav>

    <!-- 主内容区域 -->
    <main class="main-content">
      <router-view />
    </main>

    <!-- 页脚 -->
    <footer class="footer">
      <p>&copy; 2025 OpenLayers Demo Application</p>
    </footer>
  </div>
</template>

<style scoped>
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.navbar {
  background-color: #2c3e50;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav-link:hover {
  background-color: #34495e;
}

.nav-link.router-link-active {
  background-color: #16a085;
  font-weight: bold;
}

.main-content {
  flex: 1;
  padding: 2rem;
}

.footer {
  background-color: #ecf0f1;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* 通用按钮样式 */
button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin: 0 0.5rem;
  transition: background-color 0.3s, transform 0.1s;
}

button:hover {
  background-color: #2980b9;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

/* 地图特定按钮 */
.map-button {
  background-color: #27ae60;
}

.map-button:hover {
  background-color: #229954;
}

/* GeoServer特定按钮 */
.geoserver-button {
  background-color: #e74c3c;
}

.geoserver-button:hover {
  background-color: #c0392b;
}

/* 表单组样式 */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.form-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 控制按钮组 */
.control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
</style>